package juc.delayqueue;

import java.time.Duration;

/**
 * @author 王霄
 * @date 2022/7/23 19:15
 */
public class DelayQueueDemo {
    public static void main(String[] args) {

        OrderDelayed orderDelayed = OrderDelayed
                .builder()
                .orderId("1234")
                .createTime(System.currentTimeMillis())
                .expireTime(System.currentTimeMillis() + Duration.ofSeconds(10).toMillis())
                .build();

        OrderRunner orderRunner = new OrderRunner();
        orderRunner.add(orderDelayed);

        orderRunner.run();
    }
}
